﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers.popups {
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.views.popups.*;
    import org.robotlegs.mvcs.*;

    public class DestroyPopupCommand extends Command {

		[Inject]
        public var event:InfoEvent;
		[Inject]
        public var popupModel:PopupModel;
		[Inject]
        public var ticker:TickModel;

        override public function execute():void{
            var _local1:IPopupView;
            this.popupModel.closePopup(IPopupView(this.event.info));
            if (!this.popupModel.hasOpenPopups){
                _local1 = this.popupModel.getNextinQueue();
                if (_local1){
                    this.popupModel.showPopup(_local1);
                } else {
                    this.ticker.pause = false;
                };
            };
        }

    }
}//package net.wooga.pets.controllers.popups 
